<bdc:keywords data='new project, sample project, quick start' />
<h3>Prerequisites</h3>
<p>We need the following:</p>
<ol>
<li>Bulldoc distributive, please refer to <bdc:link page='installation.html'/> chapter</li>
<li>Web-site on your computer under Apache web-server</li>
<li>Suppose that files lie in <span class='filepath'>/home/bulldoc</span>, and website is available via <span class='filepath'>http://bulldoc</span>.</li>
</ol>

<p>Unpack files into <span class='filepath'>/home/bulldoc</span></p>

<h3>Draft book plan</h3>
<p>Our book will be pretty simple. Some chapters, introuduction. Let's name our book 'Web for lemmings'. We'll make draft plan:</p>
<pre>
Web for lemmings
=======================

Introduction
Browsers
  Firefox
  Opera
</pre>

<h3>Create new project</h3>
<p>In <span class='filepath'>/home/bulldoc</span> run command:</p>
<code class='commandline'>
bulldoc -c lemmings
</code>

<p>This command will create 2 directories:<br/>
<span class='filepath'>/home/bulldoc/workshop/source/lemmings</span><br/>
<span class='filepath'>/home/bulldoc/workshop/source/lemmings/pages</span><br/>
</p>

<p>And two files:<br/>
empty <span class='filepath'>/home/bulldoc/workshop/source/lemmings/toc.yml</span><br/>
and <span class='filepath'>/home/bulldoc/workshop/source/lemmings/book_data.yml</span><br/>
</p>

<p>
It will also add the following line to file <span class='filepath'>/home/bulldoc/workshop/source/bookshelf.yml</span>:</p>
<pre>
lemmings:
</pre>

<p>Edit file <span class='filepath'>/home/bulldoc/workshop/source/lemmings/book_data.yml</span>, to indicate author, book's title, web-site and copyright:</p>
<pre>
title: Web for lemmings
author: Shadow wizard

copyright: Shadow Wizard, 2008
site: www.lemmings-web.net
</pre>

<p>
Note, you can create project right from Bulldoc's start page, i.e. from the bookshelf. Click "create book" link. Fill just the keyword field with "lemmings", optionally fill the book's data fields (name, author, etc.)  and you're done. But it is worth to know file structure, that's why we use command line and edit files in editor.
</p>

<p>The system already could work with our book. Point your browser to <span class='filepath'>http://bulldoc</span> and see your book in available books list. Click the link and you'll see the first page. It is still empty. Let's do something with it.</p>

<h3>Table of contents file</h3>
<p>Let's fill up <span class='filepath'>/home/bulldoc/workshop/source/lemmings/toc.yml</span> file. Use the following code (you can use web-interface, by pressing 'Edit TOC' in top-right menu):</p>
<pre>
introduction.html: Introduction
browsers:
  type: chapter
  title: Browsers
  topics:
    firefox.html: Firefox
    opera.html: Opera
</pre>
<p>Review your book in the browser <span class='filepath'>http://bulldoc/lemmings</span>. You can see outline, navigation and silly 'Under construction' message instead of page's content. Now let's write our pages.</p>

<h3>The content</h3>
<p>Create file <span class='filepath'>/home/bulldoc/workshop/source/lemmings/introduction.html</span>. Put the following content into it:</p>
<div class='file'>
&lt;bdc:keywords data='browser' />
<p>&lt;p><br/>
&lt;b>A web browser &lt;/b> is a software application which enables a user to display and interact with text, images, videos, music, games and other information typically located on a web page at a website on the World Wide Web or a local area network. Text and images on a web page can contain hyperlinks to other web pages at the same or different website. Web browsers allow a user to quickly and easily access information provided on many web pages at many web sites by traversing these links.<br/>
&lt;/p></p>
<p>&lt;p><br/>
Although browsers are typically used to access the World Wide Web, they can also be used to access information provided by web servers in private networks or content in file systems.<br/>
&lt;/p></p>
<p>&lt;p><br/>
The purpose of a web browser is to display web pages to the user. This process begins when the user inputs a Uniform Resource Identifier (URI), for example http://en.wikipedia.org/, into the browser. The prefix of the URI determines how the URI will be interpreted. The most commonly used kind of URI starts with http: and identifies content to be retrieved over Hypertext Transfer Protocol (HTTP). Many browsers also support a variety of other prefixes, such as https: for HTTPS, ftp: for the File Transfer Protocol, and file: for local files. Prefixes that the web browser cannot directly handle are often handed off to another application entirely. For example, mailto: URIs are usually passed into the user's default e-mail application, and news: URIs are passed to the user's default newsgroup reader.<br/>&lt;/p></p>
<p>&lt;p><br/>
The Opera browser is a good example.<br/>&lt;/p></p>

</div>

<p>Look at the result: <span class='filepath'>http://bulldoc/lemmings/introduction.html</span></p>

<p>Create files about browsers and fill them (you can use web-interface. Just use table of contents page and open page you want to edit. Press 'Edit' link):</p>
<div><b>/home/bulldoc/workshop/source/lemmings/browsers/firefox.html</b></div>
<div  class='file'>
&lt;bdc:keywords data='netscape, mozilla, firefox' />
<p>&lt;p><br/>
Mozilla was the official, public, original name of Mozilla Application Suite by the Mozilla Foundation, currently known as SeaMonkey suite.
<br/>&lt;/p></p>
<p>&lt;p><br/>
The name has been used in a number of ways and in combination with other phrases, though all of them have been related to the now-defunct Netscape Communications Corporation and its related application software.
<br/>&lt;/p></p>
<p>&lt;p><br/>
Only three things have ever formally used the term "Mozilla" alone:
the codename for the Netscape Navigator software project
the official name of what was re-named Mozilla Application Suite
the Mascot of Netscape.
<br/>&lt;/p></p>
</div>
<div><b>/home/bulldoc/workshop/source/lemmings/browsers/opera.html</b></div>
<div class='file'>
&lt;bdc:keywords data='opera, opera mini' />
<p>&lt;p><br/>
Opera is a web browser and Internet suite developed by the Opera Software company. Opera handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent, and reading web feeds. Opera is offered free of charge for personal computers and mobile phones, but for other devices it must be paid for.
<br/>&lt;/p></p>
<p>&lt;p><br/>
Features of Opera include tabbed browsing, page zooming, mouse gestures, and an integrated download manager. Its security features include built-in phishing and malware protection, strong encryption when browsing secure web sites, and the ability to easily delete private data such as cookies and browsing history by simply clicking a button.
<br/>
&lt;/p></p>
<p>&lt;p><br/>

Opera runs on a variety of personal computer operating systems, including Microsoft Windows, Mac OS X, Linux, FreeBSD, and Solaris.[2] Though evaluations of Opera have been largely positive, Opera has captured only a fraction of the worldwide personal computer browser market.<br/>&lt;/p></p>
</div>

<p>Walk throug pages, and check the result.</p>
<p>Place this <a href='firefox.png'>logo</a> into <span class='filepath'>/home/bulldoc/workshop/source/lemmings/browsers/firefox.png</span> and edit <span class='filepath'>/home/bulldoc/workshop/source/lemmings/browsers/firefox.html</span> by adding </p>
<pre>
&lt;img src='firefox.png'>
</pre>
<p>to beginning of the file.</p>

<p>Check the result.</p>
<p>Edit <span class='filepath'>/home/bulldoc/workshop/source/lemmings/introduction.html</span>, by replacing Opera with</p>
<pre>
&lt;bdc:link page='browsers/opera.html' />
</pre>
<p>Check the result.</p>

<p>You can add PHP-code to any page:</p>
<pre class="php">&lt;bdc:php>&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _yamlizeArray<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$array</span>,<span style="color: #0000ff;">$indent</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/is_array"><span style="color: #000066;">is_array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$array</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$string</span> = <span style="color: #ff0000;">''</span>;
      <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$array</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span> =&gt; <span style="color: #0000ff;">$value</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$string</span> .= <span style="color: #0000ff;">$this</span>-&gt;_yamlize<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$key</span>,<span style="color: #0000ff;">$value</span>,<span style="color: #0000ff;">$indent</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$string</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
&lt;/bdc:php>  
</pre>
<p>You should see the highlighting.</p>

<h3>The index</h3>
<p>Add Index page to the Table of Contents file <span class='filepath'>/home/bulldoc/workshop/source/lemmings/toc.yml</span> (you can also use web-interface by pressing TOC-edit link on the top):</p>
<pre>
introduction.html: Introduction
browsers:
  type: chapter
  title: Browsers
  topics:
    firefox.html: Firefox
    opera.html: Opera
topic_index.html: {type: index, title: Index}
</pre>

<p>Check the Index page &mdash; there are something allready!</p>

<h3>Let's add the cover image</h3>
<p>Save <a href='lemmings_cover.png'>this</a> picture as <span class='filepath'>/home/bulldoc/workshop/source/lemmings/pages/cover.png</span>. Point your browser to the first book's page (<span class='filepath'>http://bulldoc/lemmings</span>), press "Edit" link and place the following content:
</p>
<pre>
&lt;img src='cover.png' style='display: block'>
&lt;h2>Table of contents&lt;/h2>
</pre>
<p>Now you can see an image. More over, your bookshelf will display the book's cover in the book list.</p>

<h3>Export to static html</h3>
<p>Let's export book to the html-files. Type in your command line</p>
<code class='commandline'>
cd /home/bulldoc
bulldoc lemmings
</code>
<p>Look into <span class='filepath'>/home/bulldoc/workshop/output/lemmings</span> for the result.</p>